
# Online Python - IDE, Editor, Compiler, Interpreter

a=int(input())
k=0
s=a
while a>0:
    a //= 10
    k+=1
if k!=4:
    print(0)
else:
    while s>0:
        if (s%10)//1 and (s%10)//(s%10):
            print(s%10)
    
        

